package com.bw.controller;

import com.bw.bean.Car;
import com.bw.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class CarController {
    @Autowired
    CarService carService;

    @RequestMapping("/list")
    public List getList(String name,String carno){
        List<Car> list = carService.getList(name, carno);
        return list;
    }

    @RequestMapping("/add")
    public int getCarService(String name, String idcard, String tel, String carno, String cname, int tid, int status, String appointdate) {
        return carService.add(name,idcard,tel,carno,cname,tid,status,appointdate);
    }

    @RequestMapping("/delete")
    public int getDel(int[] ids){
        return carService.delete(ids);
    }
}
